/************** init.html **************/
function query_invBusinessType(page) {
	sys_loading();
	var parm = $('#queryInvBusinessTypeForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('invBusinessType-query');
	sys_record_parm('invBusinessType',parm);
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#invBusinessTypeResultList').html(result);
		}
	});
}
function save_invBusinessType() {
	var parm = $('#editForm').serialize();
	var url = create_url('invBusinessType-save');
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if (result == 'success') {
				sys_msg('操作成功!');
				sys_load_handle('invBusinessType');
			} else if(result == 'exists') {
				sys_msg("名称不能重复！");
			}else {
				sys_warning('操作失败!');
			}
		}
	});
}


function shield_invBusinessType(code, name) {
	$.Zebra_Dialog('确定屏蔽吗？',{
	'type': 'question','title': '警告' ,'buttons':[
       {caption:'屏蔽',callback:function() {
    	   var url = create_url('invBusinessType-shield');
    	   aidExecute_invBusinessType(code, url);
		}},
       {caption:'取消',callback:function(){}
       }]
	});
}

function aidExecute_invBusinessType(code, name) {
	$.Zebra_Dialog('确定要解除屏蔽吗？',{
	'type': 'question','title': '警告' ,'buttons':[
       {caption:'解除',callback:function() {
    	   var url = create_url('invBusinessType-unshield');
    	   aidExecute_invBusinessType(code, url);
		}},
       {caption:'取消',callback:function(){}
       }]
	});
}
function aidExecute_invBusinessType(code, url) {
	var parm = {'code':code};
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if ('success' == result) {
				query_InvBusinessType();
			} else {
				$.Zebra_Dialog('操作失败，请刷新页面再次尝试，如果问题依然存在，请联系管理员!');
			}
		}
	});
}

function selectOrgan_invBusinessType() {
	var url = create_url('invBusinessType-aidInit');
	var parm = {'id':'oc', 'name':'on'};
	$.colorbox({overlayClose:false, href:url, data:parm, close:'[关闭]', width:'800px', height:'600px', open:true});
}



